<!-- 头部 -->
<include file="Public:header"/>

<div class="row-fluid" id="main">
    <div class="span8 offset2">
        <form class="form-horizontal " method="post" action="">
            <h3>个人基本信息</h3>
            <div class="control-group">
                <label class="control-label" for="inputGrade">班级</label>
                <div class="controls">
                    <html:select options='gradeList' name='grade_id'/>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputName">姓名</label>
                <div class="controls">
                    <input type="text" name="name" id="inputName" placeholder="姓名">
                </div>
            </div>

            <div class="control-group">
                <label class="control-label" for="inputSex">性别</label>
                <div class="controls">
                    <input type="radio" name="sex" checked="true" value="1">男
                    <input type="radio" name="sex" value="0">女
                </div>
            </div>


            <div class="control-group">
                <label class="control-label" for="inputAge">年龄</label>
                <div class="controls">
                    <input type="text" name="age" id="inputAge" placeholder="年龄">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputAddress">籍贯</label>
                <div class="controls">
                    <input type="text" name="address" id="inputAddress" placeholder="籍贯">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputEducation">学历</label>
                <div class="controls">
                    <html:select options='education' name='education'/>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label" for="inputGraduation_time">毕业时间</label>
                <!--时间组件-->
                <div class="controls">
                    <table style="text-align: right;">
                        <tr>
                            <td><select id="birth_year"  name = "graduate_year" onchange="setDays(this,birth_month,birth_day);">
                                <option value="">年</option>


                            </select> <select id="birth_month" name = "graduate_month" onchange="setDays(birth_year,this,birth_day);">
                                <option value="">月</option>

                            </select>
                                <!--<select id="birth_day" name="day">-->
                                <!--<option value="">日</option>-->

                            <!--</select>-->

                            </td>
                        </tr>
                        <tr>
                    </table>
                </div>
            </div>






            <div class="control-group">
                <label class="control-label" for="inputGraduate">毕业院校</label>
                <div class="controls">
                    <input type="text" name="graduate" id="inputGraduate" placeholder="毕业院校">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputGraduateadd">院校所在省</label>
                <div class="controls">
                    <input type="text" name="graduateadd" id="inputGraduateadd" placeholder="院校所在省">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputSubject">专业</label>
                <div class="controls">
                    <input type="text" name="subject" id="inputSubject" placeholder="专业">
                </div>
            </div>

            <div class="control-group">
                <label class="control-label" for="inputSubject">手机</label>
                <div class="controls">
                    <input class="phone" type="text" name="phone" id="inputSubject" placeholder="手机">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputSubject">QQ</label>
                <div class="controls">
                    <input class="qq" type="text" name="qq" id="inputSubject" placeholder="QQ">
                </div>
            </div>
            <h3>就业愿望</h3>
            <div class="control-group">
                <label class="control-label" for="inputMethod">就业方式</label>
                <div class="controls">
                    <html:select options='method' name='method'/>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputArea">就业地域</label>
                <div class="controls">
                    <html:select options='areaList' name='area_id'/>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputPosition">就业职位</label>
                <div class="controls">
                    <html:select options='position' name='position'/>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputPay">期望薪资</label>
                <div class="controls">
                    <html:select options='pay' name='pay'/>
                </div>
            </div>
            <h3>专业技能掌握</h3>
            <?php foreach($type as $key=>$val):?>
            <div class="control-group">
                <label class="control-label" for="<?=$val['name']?>"><?=$val['display']?></label>
                <div class="controls">
                    <select id="" name="<?=$val['name']?>" onchange="" ondblclick="" class="">
                        <option value="">--请选择--</option>
                        <option value="1">精通</option>
                        <option value="2">熟练掌握</option>
                        <option value="3">掌握</option>
                        <option value="4">熟悉</option>
                        <option value="5">了解</option>
                    </select>
                </div>
            </div>
            <?php endforeach;?>
            <div class="control-group">
                <div class="controls">
                    <label class="checkbox">
                        &nbsp;
                    </label>
                    <button onclick="return check();" class="btn btn-large btn-primary form-submit" type="submit">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;提交&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</button>
                </div>
            </div>
        </form>
    </div>
</div>
<script>
    function check() {
        if ($('.phone').val().length != 11) {
            alert('请输入正确的11位手机号码后再提交');
            return false;
        }
        if ($('.qq').val() == '') {
            alert('请输入qq号码后再提交');
            return false;
        }
        return true;

    }

    // 时间组件
    $(document).ready(function() {
        var i = -1;
        // 添加年份，从1910年开始
        for (i = 1910; i <= new Date().getFullYear(); i++) {
            addOption(birth_year, i, i - 1909);
            /*// 默认选中1988年
             if (i == 1988) {
             birth_year.options[i-1910].selected = true;
             }*/
        }
        // 添加月份
        for (i = 1; i <= 12; i++) {
            addOption(birth_month, i, i);
        }
//        // 添加天份，先默认31天
//        for (i = 1; i <= 31; i++) {
//            addOption(birth_day, i, i);
//        }



        //$("#birth_month"). birth_year  birth_day
    });


    // 设置每个月份的天数
    function setDays(year, month,day) {
        var monthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
        var yea = year.options[year.selectedIndex].text;
        var mon = month.options[month.selectedIndex].text;
        var num = monthDays[mon - 1];
        if (mon == 2 && isLeapYear(yea)) {
            num++;
        }
        for (var j = day.options.length - 1; j >=num; j--) {
            day.remove(j);
        }
        for (var i = day.options.length; i <= num; i++) {
            addOption(birth_day,i,i);
        }

    }

    // 判断是否闰年
    function isLeapYear(year)
    {
        return (year % 4 == 0 || (year % 100 == 0 && year % 400 == 0));
    }

    // 向select尾部添加option
    function addOption(selectbox, text, value) {
        var option = document.createElement("option");
        option.text = text;
        option.value = value;
        selectbox.options.add(option);
    }


</script>
<!-- 底部 -->
<include file="Public:footer"/>
